package com.myd.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.myd.dao.UserDao;
import com.myd.model.User;
import com.myd.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserSerivceImpl implements UserService {
    @Autowired
    private UserDao userDao;
    @Override
    public User search(String username, String password) {
        User user = userDao.selectOne(new QueryWrapper<User>()
                .eq("username", username)
                .eq("password", password)
        );
        return user;
    }

    @Override
    public boolean insertUser(User user) {
        System.out.println("sdddd");
        int insert = userDao.insert(user);
        return insert>0?true:false;
    }
}
